<?php

include '../core/core.php';

CCore::Using('base.followers.logger');
CCore::Using('logger.inline');
CCore::Using('logger.file');
CCore::Using('net.smtp');
CCore::Using('base.datapointer');

CCore::Using('net.socket.streams.smtpserver');

$oSmtpConfig = new CCoreNetSmtpConfig('u-server', 26, 'test@localhost', 'p12345', 'localhost1', true, 5, 5);
$oSmtp = new CCoreNetSmtp($oSmtpConfig);

$oLogger1 = new CCoreLoggerInline("\n", true);
$oLogger2 = new CCoreLoggerFile('c:/php.core.log.txt');

$oFollower1 = new CCoreBaseFollowersLogger($oLogger1);
$oFollower2 = new CCoreBaseFollowersLogger($oLogger2);

$oSmtp->AddFollower($oFollower1);
//$oSmtp->AddFollower($oFollower2);

$oSocketStream = new CCoreNetSocketStreamsSmtpServer('files.smtpserver/');
$oSmtp->SetStream($oSocketStream);

$oSmtpMessage = new CCoreNetSmtpMessage('test@localhost',
	file_get_contents('files.pop3server/uid-02.eml'), array('test@localhost'));

echo '<pre>';
if ($oSmtp->ConnectAndLogin())
{
	$oSmtp->SendMessage($oSmtpMessage);
	
	$oSmtp->LogoutAndDisconnect();
}
